<?php
namespace app\admin\model;

use think\Model;
class Announcement extends Model
{
	public function saveAnnouncement(array $announcement_info)
	{
		$announcement = new Announcement();
		$announcement_list = [
				'announcement' => $announcement_info['announcement']
		];
		if (isset($announcement_info['id'])){
			$result = $announcement->save($announcement_list,['id'=>$announcement_info['id']]);
			return $result;
		}else {
			$announcement_list['created'] = time();
			$result = $announcement->save($announcement_list);
			$result = $announcement->id;
		}
		return $result;
	}
}